package net.uhuijia.goods.goodsku.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import net.uhuijia.appbase.service.BaseService;
import net.uhuijia.goods.goodsku.persistence.model.GoodSku;
import net.uhuijia.goods.goodsku.persistence.model.GoodSkuExample;


@Service
@Transactional
public interface GoodSkuService
     extends BaseService<GoodSku,GoodSkuExample> {
	
	/**
	 * 添加商品sku
	 * @author 王文鑫  
	 * @date 2018年9月30日  
	 * @param goodId
	 * @param price
	 * @param showSkuName
	 * @param invertory
	 * @param image
	 * @param groupPropertyId
	 * @return
	 */
	GoodSku addGoodSku(String goodId,Double price,String showSkuName,int invertory,String image,String groupPropertyId);

	/**
	 * @Author xzj
	 * @Description //获取商品库存
	 * @Date  2018/10/8
	 * @Param
	 * @return
	 **/
	int getGoodSkuInvertory(String spuId,String groupPropertyId);

	/**
	 * @Author xzj
	 * @Description // 检查商品规格库存是否足够
	 * @Date  2018/10/8
	 * @Param
	 * @return
	 **/
	Boolean checkGoodSkuInvertoryIsEnough(String spuId,String groupPropertyId,Integer count);
	
	/**
	 * @Author xzj
	 * @Description //根据spuId和匹配Id查询商品Sku
	 * @Date  2018/10/8
	 * @Param
	 * @return
	 **/
	GoodSku getGoodSkuBySpuIdAndPropertyId(String spuId,String groupPropertyId);
}